package com.jsbb;

import org.mybatis.generator.api.IntrospectedTable;
import org.mybatis.generator.api.PluginAdapter;
import org.mybatis.generator.api.dom.java.Interface;

import java.util.List;

/**
 * 自定义Mapper
 *
 * @author jsbb
 */
public class MyMapperPluginAdapter extends PluginAdapter {

    @Override
    public boolean validate(List<String> list) {
        return true;
    }

    @Override
    public boolean clientGenerated(Interface interfaze, IntrospectedTable introspectedTable) {
        String remarks = introspectedTable.getRemarks();
        interfaze.addJavaDocLine("/**");
        interfaze.addJavaDocLine(" * " + remarks);
        interfaze.addJavaDocLine(" *");
        interfaze.addJavaDocLine(" * @author " + Generator.AUTHOR);
        interfaze.addJavaDocLine(" */");
        return true;
    }
}
